<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script src="/js/axios.min.js"></script>
  <script src="/js/util.js"></script>

  <script>
    var id = getQuery("id");
    window.onload = function (){
      init();
    }
    function init(){
      axios.get("/product/findById",{
        params:{id}
      }).then(resp =>{
          var info = resp.data;
          $("productImg").src = "/pimg/"+info.imgPath;
          $("nameSpan").innerHTML = info.name;
          $("priceSpan").innerHTML = info.price;
      });
    }
  </script>
</head>
<body>
  <img src="" id="productImg" width="300" height="300"><br>
  商品名：<span id="nameSpan"></span><br>
  单价：<span id="priceSpan"></span><br>
  <a href="/product/index.html">返回首页</a>
</body>
</html>